<template>
	<view class="list">
		<view class="item u-skeleton-rect" v-for="(item,index) in list" :key="index" @click="gotolink(item)" @scrolltolower='getgoods'>
			<view class="i-image">
				<u-image class="img" :src="$util.img(item.image)" mode="aspectFit" height='304' duration='600'></u-image>
			</view>
			<view class="title">{{item.name}}</view>
			<view class="die">
				<view class="price">¥{{item.price}}</view>
				<view class="num">{{item.show_volume}}人付款</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			list:{
				type:Array,
				default:()=>{
					return []
				}
			}
		},
		data() {
			return {}
		},
		mounted() {
			this.$emit('getgoods')
		},
		methods:{
			gotolink(item){
				this.$util.redirectTo('/pages/shopping/goodsDetail',{id:item.id});
			},
			getgoods(){
				console.log("chufa")
			}
		}
	}
</script>

<style lang="scss" scoped>

	.list {
		margin: 0 30rpx;
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;

		.item {
			margin: 0 0 20rpx 0;
			width: 335rpx;
			height: 476rpx;
			background: #FFFFFF;
			border-radius: 10rpx;
			padding: 12rpx;
			box-sizing: border-box;

			.i-image {
				margin-bottom: 22rpx;

				.img {
					width: 100%;
					// height: 304rpx !important;
					border-radius: 6rpx;
				}
			}

			.title {
				width: 100%;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
				-o-text-overflow: ellipsis;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 500;
				margin-bottom: 40rpx;
			}
			.die{
				display: flex;
				align-items: center;
				justify-content: space-between;
				.price{
					font-size: 30rpx;
					font-family: PingFang SC;
					font-weight: 800;
					color: #000000;
				}
				.num{
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
				}
			}
		}

		.item:nth-child(2n) {
			margin-right: 0;
		}
		
	}
</style>